import hvac
import os

# 请在环境变量里设置 VAULT_ADDR 和 VAULT_TOKEN
def load(path):
  vault = hvac.Client()
  ret = vault.secrets.kv.read_secret_version(path)
  for key in ret['data']['data']:
    # print(key, ret['data']['data'][key])
    os.environ[key] = ret['data']['data'][key]
  return os.environ